package codechicken.wirelessredstone.core;

import net.minecraft.src.Chunk;
import net.minecraft.src.NBTTagCompound;
import net.minecraft.src.World;
import net.minecraft.src.forge.ICustomSaveHandler;

public class RedstoneEtherSaveHandler implements ICustomSaveHandler
{
	private RedstoneEtherSaveHandler()
	{}
	
	public void onWorldLoad(World newworld)
	{
		RedstoneEther.reload(newworld);
	}

	public void onWorldSave(World world)
	{
		RedstoneEther.saveEther(world);
	}

	public void onChunkLoad(World world, Chunk chunk)
	{
		if(!world.isNewWorld)
		{
			RedstoneEther.verifyChunkTransmitters(world, chunk.xPosition, chunk.zPosition);
		}
	}
	
	public void onChunkUnLoad(World world, Chunk chunk)
	{
	}
	
	public void saveChunkData(World world, Chunk chunk, NBTTagCompound nbttagcompound)
	{
	}

	public void loadChunkData(World world, Chunk chunk, NBTTagCompound nbttagcompound)
	{
	}
	
	public static RedstoneEtherSaveHandler getInstance()
	{
		return instance;
	}
	
	private static RedstoneEtherSaveHandler instance = new RedstoneEtherSaveHandler();
}
